<?
class User
{
	public $UserId = '';

	public function __construct($UserId)
	{
		$this->secureId = $UserId;
		if(!$this->checkDB())
		{
			$this->updateDB();
		}
	}
	public function checkDB()
	{
		$query = "select * from user where facebook_id='".$this->secureId."'";	
		$queryId = mysql_query($query);
		return mysql_num_rows($queryId);
	}
	public function updateDB()
	{
		$query = "insert into user (user_id,facebook_id) values (null,'".$this->secureId."')";
		mysql_query($query);
	}

}

?>





